home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.2 / Video Toaster v4.2.iso / 3rdparty / ybt / flyerplusybt < prev    next >
Text File  |  1997-04-30  |  4KB  |  157 lines

  1. /* StartToaster V2.1 -- Have the flyer start up however you like.      */
  2. /* By Bob Caron (Grue) © 1995 NewTek Inc.                              */
  3.  
  4. OPTIONS RESULTS
  5. TOASTERLIB="ToasterARexx.port"
  6.  
  7. call remlib('rexxsupport.library')
  8. call addlib("rexxsupport.library", 0,-30,0)
  9. call remlib('ToasterARexx.port')
  10. call remlib('PROJECT_REXX_PORT')
  11.  
  12. if ~exists("toaster:") then do
  13.   say "Start Toaster V2.1"
  14.   say
  15.   say "Your Toaster: assignment is missing, or has been removed."
  16.   say
  17.   say "Some possible solutions:"
  18.   say
  19.   say "1) Reboot your computer and try again."
  20.   say "2) Re-Install your Toaster/Flyer software."
  21.   say "   (A minimal install is sufficient.)"
  22.   say
  23.   say "Press <Return> to continue."
  24.   pull stuff
  25.   call quit
  26.   end
  27.  
  28. if ~exists("toaster:programs/videotoaster") then do
  29.   say "Start Toaster V2.1"
  30.   say
  31.   say "I can't find the program 'VideoToaster' (needed for this software to run)."
  32.   say
  33.   say "Some possible reasons for this failure:"
  34.   say
  35.   say "1) Your toaster: assign may be pointing to the wrong location."
  36.   say "2) You are running ScreamerNet. StartToaster MUST be run before you"
  37.   say "   run a ScreamerNet node."
  38.   say "3) Your Toaster software is missing important system files."
  39.   say "   Run CheckSoftware to verify."
  40.   say
  41.   say "Press <Return> to continue."
  42.   pull stuff
  43.   call quit
  44.   end
  45.  
  46. startdir="toaster:arexx/editor/StartUpScripts"
  47.  
  48. if exists(startdir) then startup=1
  49. else startup=0
  50.  
  51. dir=showdir(startdir,'f','*')
  52. temp=translate(dir,'?',' ','?')
  53. temp2=translate(temp,' ','*',' ')
  54. dir = temp2
  55.  
  56. IF SHOW('Ports','PROJECT_REXX_PORT') THEN
  57.   IF ADDLIB('ToasterARexx.port' , 0) THEN x=Bummer("The Video Toaster/Flyer software is already running!! ")
  58.  
  59. call pragma("D","toaster:programs")
  60.  
  61. address command "run >NIL: toaster:programs/videotoaster"
  62.  
  63. do while ~SHOW('Ports','PROJECT_REXX_PORT')
  64.    address command "c:wait 1"
  65. end
  66.  
  67. call addlib('PROJECT_REXX_PORT' , 0)
  68. call addlib('ToasterARexx.port' , 0)
  69.  
  70. /* Add Startup Code here... */
  71.  
  72. call set_view(4)
  73.  
  74. if startup=1 then do
  75.    loopto=words(dir); loop=1
  76.    do while (loop<loopto+1)
  77.       program=translate(word(dir,loop),' ','?')
  78.       filenam=program
  79.       if upper(right(program,5))=".REXX" then
  80.          filenam=left(program,length(filenam)-5)
  81.       if isarexx(startdir||"/"||program) then
  82.          number=LADDTOOL(filenam,startdir||"/"||program||" 1",1)
  83.       if number=12 then break
  84.       loop=loop+1
  85.    end
  86. end
  87.  
  88.  
  89.  
  90. /* ADD YBT TO PROGRAM POPUP*/
  91. /* Added by D. Wolf to make YBT available at Toaster Startup time!*/
  92. /* This is quite like the addybt.rexx found on the YBT disk.*/
  93.  
  94. YBTNAME="  YBT"
  95. YBTCOMMAND="toaster:startybt.rexx"
  96. call ADDPROGRAM(YBTNAME,YBTCOMMAND,1)
  97.  
  98. YBTNAME="  YBT-REDO"
  99. YBTCOMMAND="toaster:redoybt.rexx"
  100. call ADDPROGRAM(YBTNAME,YBTCOMMAND,1)
  101.  
  102. YBTNAME="  YBT-JUMP"
  103. YBTCOMMAND="toaster:jumpybt.rexx"
  104. call ADDPROGRAM(YBTNAME,YBTCOMMAND,1)
  105.  
  106.  
  107. /* End of added stuff to make YBT available*/
  108.  
  109.  
  110.  
  111.  
  112. /* End of code. */
  113.  
  114. quit:
  115.  
  116. call remlib('ToasterARexx.port')
  117. call remlib('PROJECT_REXX_PORT')
  118. call remlib('rexxsupport.library')
  119. exit
  120.  
  121.  
  122.  
  123.  
  124. bummer: /* <- An Arnie like error system */
  125. parse arg message
  126. say "Start Toaster V2.1"
  127. say
  128. say message
  129. address command "c:wait 3"
  130. exit
  131.  
  132. isarexx:
  133. parse arg file
  134. if exists(file) then do
  135.     if open('infile',file,'READ') then do
  136.        filestart = readch('infile',2)
  137.        call close('infile')
  138.        if filestart="/*" then return 1
  139.     end
  140. end
  141. return 0
  142.  
  143. laddtool: procedure
  144. parse arg filenam,start,number
  145.  
  146. signal on error
  147. signal on syntax
  148.  
  149. call ADDTOOL(filenam,start,number)
  150.  
  151. syntax:
  152. error:
  153.  
  154. signal off error
  155.  
  156. return rc
  157.